package com.springboot.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.springboot.po.Food;
import com.springboot.service.FoodService;

@RequestMapping(path = "/FoodController" , method = RequestMethod.POST)
@RestController
public class FoodController {
	@Autowired
	FoodService foodService;
	
	@RequestMapping("/getFoodById")
	public Food getFoodById(int foodId) throws Exception{
		return foodService.getFoodById(foodId);
	}
	
	@RequestMapping("/listFoodByBusinessId")
	public List<Food> listFoodByBusinessId(Food food) throws Exception{
		return foodService.listFoodByBusinessId(food.getBusinessId());
	}
}
